NetworkScanner.LantronixDevice
parsing based on the following c code from Lantronix tech support forums:
len = recvfrom(sock, buf, sizeof(buf), 0, (struct sockaddr *)&from, &fromLen);
if (len > 4) {
if (buf[3] != 0xf7) {
printf("buf[3]=%x\n", buf[3]);
continue;
}
printf("Type : %02x-%02x (%c%c)\n", buf[8], buf[9], buf[8], buf[9] );
printf("Version : Major.Minor: %d.%d\n", buf[7], buf[6] );
printf("Serial #: %02x-%02x-%02x-%02x\n", buf[20], buf[20+1], buf[20+2],
buf[20+3]);
printf("MAC : %02x-%02x-%02x-%02x-%02x-%02x\n", buf[24], buf[24+1],
buf[24+2], buf[24+3], buf[24+4], buf[24+5]);
printf("IP Addr : %s\n", inet_ntoa(from.sin_addr));
} else {
printf("erroneous data.\n");
}
printf("\n");
|